home *** CD-ROM | disk | FTP | other *** search
/ Programming an RTS Game with Direct3D / Programming an RTS Game with Direct3D.iso / Examples / Chapter 10 / Example 10.1 / player.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-06-30  |  1.0 KB  |  41 lines

  1. #ifndef _RTS_PLAYER_
  2. #define _RTS_PLAYER_
  3.  
  4. #include <vector>
  5. #include "shader.h"
  6. #include "camera.h"
  7. #include "unit.h"
  8. #include "building.h"
  9. #include "terrain.h"
  10.  
  11. void LoadPlayerResources(IDirect3DDevice9* Device);
  12. void UnloadPlayerResources();
  13.  
  14. class PLAYER
  15. {
  16.     friend class APPLICATION;
  17.     public:
  18.         PLAYER(int _teamNo, D3DXVECTOR4 _teamCol, INTPOINT startPos, TERRAIN* _terrain, IDirect3DDevice9* _Device);
  19.         ~PLAYER();
  20.  
  21.         void AddMapObject(int type, INTPOINT mp, bool isBuilding);
  22.         void RenderMapObjects(CAMERA &camera);
  23.         void PaintSelectedMapObjects(CAMERA &camera);
  24.         void UpdateMapObjects(float deltaTime);
  25.         INTPOINT FindClosestBuildingLocation(int buildType, INTPOINT mp);
  26.         void Select(MOUSE &mouse);
  27.         void UnitOrders(MOUSE &mouse);
  28.         INTPOINT GetCenter();
  29.         void IsMapObjectsVisible();
  30.  
  31.     private:
  32.         IDirect3DDevice9* m_pDevice;
  33.         std::vector<MAPOBJECT*> m_mapObjects;
  34.         D3DXVECTOR4 m_teamColor;
  35.         TERRAIN *m_pTerrain;
  36.         int m_teamNo;
  37.         bool m_areaSelect;
  38.         INTPOINT m_startSel;
  39. };
  40.  
  41. #endif